package aa.jx.order.model;

import java.math.BigDecimal;
import java.util.List;

public class Product {
    private Integer id;
    private Integer categoryId;
    private String name;
    private BigDecimal price;
    private Integer stock;
    private Integer status;
    private Integer isHot;
    private String mainImage;
    private String subImages;
    private String detail;
    private Integer sales;

    // 非数据库字段，用于业务逻辑
    private List<ProductSpec> specs;
    private ProductCategory category;

    // 构造方法
    public Product() {
    }

    public Product(Integer id, Integer categoryId, String name, BigDecimal price, Integer stock, Integer status,
                   Integer isHot, String mainImage, String subImages, String detail, Integer sales) {
        this.id = id;
        this.categoryId = categoryId;
        this.name = name;
        this.price = price;
        this.stock = stock;
        this.status = status;
        this.isHot = isHot;
        this.mainImage = mainImage;
        this.subImages = subImages;
        this.detail = detail;
        this.sales = sales;
    }

    // Getter和Setter方法
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getHot() {
        return isHot;
    }

    public void setHot(Integer isHot) {
        this.isHot = isHot;
    }

    public String getMainImage() {
        return mainImage;
    }

    public void setMainImage(String mainImage) {
        this.mainImage = mainImage;
    }

    public String getSubImages() {
        return subImages;
    }

    public void setSubImages(String subImages) {
        this.subImages = subImages;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public Integer getSales() {
        return sales;
    }

    public void setSales(Integer sales) {
        this.sales = sales;
    }

    public List<ProductSpec> getSpecs() {
        return specs;
    }

    public void setSpecs(List<ProductSpec> specs) {
        this.specs = specs;
    }

    public ProductCategory getCategory() {
        return category;
    }

    public void setCategory(ProductCategory category) {
        this.category = category;
    }

    @Override
    public String toString() {
        return "Product{" +
                "id=" + id +
                ", categoryId=" + categoryId +
                ", name='" + name + '\'' +
                ", price=" + price +
                ", stock=" + stock +
                ", status=" + status +
                ", isHot=" + isHot +
                ", mainImage='" + mainImage + '\'' +
                ", subImages='" + subImages + '\'' +
                ", detail='" + detail + '\'' +
                ", sales=" + sales +
                '}';
    }
}
